<include file="header" />
<!-- Content Header (Page header) -->
    <section class="content-header">
      <h1> 更新配置 </h1>
      <ol class="breadcrumb">
        <li><a href="__APP__/TIFAWEB_DSWJCMS.html" class="goindex"><i class="fa fa-dashboard"></i> 首页</a></li>
        <li>系统配置</li>
        <li><a href="__APP__/TIFAWEB_DSWJCMS/Index/system.html" class="goindex"><i class="fa fa-dashboard"></i> 网站配置 </a></li>
        <li class="active">更新配置</li>
      </ol>
    </section>
<!--主体-->
    <!-- Main content -->
  <section class="content">
    <form method="post"  action='__APP__/TIFAWEB_DSWJCMS/Index/savesys'>
    <input name="id" type="hidden" value="{$Think.get.id}" />
    <div class="box">
    <div class="box-body">
    <table class="table table-bordered">
     <volist name="edlist" id="ed">
       <tbody>
          <tr>
            <td>
                   参数说明：
            </td>
            <td>
              <input name="state" type="text" class="form-control" placeholder="请输入参数说明..." value="{$ed.state}">
            </td>
          </tr>
          <tr>
            <td>
                   输入提示：
            </td>
            <td>
              <input name="prompt" type="text" class="form-control" placeholder="请输入输入提示..." value="{$ed.prompt}">
            </td>
          </tr>
          <tr>
            <td>
                   参数值：
            </td>
            <td>
              <input name="value" type="text" class="form-control" placeholder="请输入参数值..." value="{$ed.value}">
            </td>
          </tr>
          <tr>
            <td>
                   变量名：
            </td>
            <td>
              <input name="name" type="text" class="form-control" placeholder="请输入变量名以sys_开头..."  value="{$ed.name}">
            </td>
          </tr>
          <tr>
            <td>
                   表单类型：
            </td>
            <td class="form-group">
              <label><input type="radio" name="type" class="minimal" value="1" <eq name="ed.type" value="1">checked</eq>>文本域</label>
              <label><input type="radio" name="type" class="minimal" value="2" <eq name="ed.type" value="2">checked</eq>>文本区域</label>
              <label><input type="radio" name="type" class="minimal" value="3" <eq name="ed.type" value="3">checked</eq>>文件域</label>
            </td>
          </tr>
        </tbody>
     </volist>
     </table>
    </div>
    </div>
    <div class="row">
     <button class="btn btn-primary pull-right" style="margin-right: 15px;"  type="submit">
                  确认修改
              </button>
    </div>
    </form>
    
    
  </section>
<include file="footer" />
<script>
//图片上传处理
window.URL = window.URL || window.webkitURL;
    var fileElem = document.getElementById("fileElem"),
    fileList = document.getElementById("fileList");
	fileList.addEventListener('click',function(){
		fileElem.click();
	},false);
    function handleFiles(obj) {
        var files = obj.files,
        img = new Image();
        if(window.URL){
            //File API
            //alert(files[0].name + "," + files[0].size + " bytes");
            img.src = window.URL.createObjectURL(files[0]); //创建一个object URL，并不是你的本地路径
            img.onload = function(e) {
                window.URL.revokeObjectURL(this.src); //图片加载后，释放object URL
            }
			
            fileList.innerHTML='<img src="'+img.src+'"/>';
			getBase64Image(img);
        }else if(window.FileReader){
            //opera不支持createObjectURL/revokeObjectURL方法。我们用FileReader对象来处理
            var reader = new FileReader();
            reader.readAsDataURL(files[0]);
            reader.onload = function(e){
               // alert(files[0].name + "," +e.total + " bytes");
                img.src = this.result;
                img.width = 200;
                 fileList.innerHTML='<img src="'+img.src+'"/>';
            }
        }else{
            //ie
            obj.select();
            obj.blur();
            var nfile = document.selection.createRange().text;
            document.selection.empty();
            img.src = nfile;
            img.width = 200;
            img.onload=function(){
                //alert(nfile+","+img.fileSize + " bytes");
            }
            fileList.innerHTML='<img src="'+img.src+'"/>';
        }
    }
	function getBase64Image(img) {  
		 var canvas = document.createElement("canvas");  
		 canvas.width = img.width;  
		 canvas.height = img.height;  
		 var ctx = canvas.getContext("2d");  
		 ctx.drawImage(img, 0, 0, img.width, img.height);  
		 var ext = img.src.substring(img.src.lastIndexOf(".")+1).toLowerCase();  
		 var dataURL = canvas.toDataURL("image/"+ext);  
		 return dataURL;  
	}
</script>